package cn.larry.aop.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.larry.aop.service.TargetService;

/**
 * @author LarryZeal
 *
 */
@Profile("target")
@RestController
@RequestMapping("/target")
public class TargetController {
	@Autowired
	private TargetService targetService;

	@GetMapping("/hi")
	public String hi() {
		targetService.sayHi();
		return "done!";
	}

	@GetMapping("/hi/{name}")
	public String hi(@PathVariable String name) {
		targetService.sayHi(name);
		return "done!";
	}
}
